package com.ndp.fb.rdb.db.impl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 * Created by hunk.qin on 2015/3/25.
 */
public class InsertVpiInfo {

    public static void main(String[] args) throws  Exception{

        Class.forName("com.mysql.jdbc.Driver");
        Connection conn= DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/pmdr?useUnicode=true&characterEncoding=UTF-8", "root", "root");
        Statement statement = conn.createStatement();
        String sql = "INSERT INTO vpi_info VALUES (15,636252029742293,'Deep Space Fleet','itunes','',300,'manual','2015-03-25 21:51:12','2015-03-25 21:51:18')";
        statement.executeUpdate(sql);
        String [] countrys="US ,DE, NO".split(",");
        for (String country : countrys) {
            String sql1="INSERT INTO vpi_country_info  (vpi_info_id,country_code,country_name) VALUES (15,'"+country.trim()+"','"+country+"')";
            statement.executeUpdate(sql1);
        }
        System.out.println("insert success");

    }
}
